The present invention relates to microcontroller systems having flash memory in a program memory address space and, in particular, to a microcontroller system that selectively allocates portions of the program memory space to either internal or external memories, or a combination thereof, for reasons of security of the internal memory contents.
Microcontroller systems including memory are known in the art. With a conventional microcontroller system, blocks of the memory may be locked such that a locked block cannot be interrogated. This locking thus secures program code contained in the locked blocks from unauthorized access by firmware piraters and from accidental erasing and programming.
However, conventionally, neither can the locked blocks be conveniently reprogrammed or accessed by an authorized user. It is desirable for a microcontroller system to be configurable such that blocks of memory ca be locked from unauthorized interrogation or code corruption, but can also be reprogrammed and/or accessed under a predetermined secure environment.
In accordance with the present invention, a microcontroller system includes program memory space allocation means. In a first mode of operation, a first block of program memory is hidden for code fetching such that a processor is prohibited from retrieving program instructions from the first block of program memory. In a second mode, however, the first block of program memory is accessible for code fetching. In a third mode of operation, the program memory space allocation means allocates the program memory space such that the processor may retrieve program instructions only from an external memory, that is not unitarily formed in the integrated circuit. In some embodiments, the mode of operation of the program memory space allocation is controlled in response to the contents of a configuration register.
By having means to so allocate the program memory, the security of the program memory is enhanced.